package com.jeesite.modules.fl.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.common.utils.excel.annotation.ExcelField;

@Table(name = "fl_leaguer", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "name", attrName = "name", label = "姓名", queryType = QueryType.LIKE),
        @Column(name = "id_number", attrName = "idNumber", label = "身份证号", queryType = QueryType.LIKE),
        @Column(name = "cellphone", attrName = "cellphone", label = "手机号"),
        @Column(name = "sex", attrName = "sex", label = "性别"),
        @Column(name = "birthday", attrName = "birthday", label = "出生日期"),
        @Column(name = "is_enterprise", attrName = "isEnterprise", label = "是否为企业会员"),
        @Column(name = "enterprise", attrName = "enterprise.id", label = "归属企业"),
        @Column(name = "register_date", attrName = "registerDate", label = "注册时间"),
        @Column(name = "binding_record", attrName = "bindingRecord", label = "绑定记录"),
        @Column(name = "last_visit_date", attrName = "lastVisitDate", label = "上次访问时间"),
        @Column(name = "insurer", attrName = "insurer", label = "保险公司"),
        @Column(name = "insurance_number", attrName = "insuranceNumber", label = "保险卡号"),
        @Column(name = "certificate_type", attrName = "certificateType", label = "证件类型"),
        @Column(name = "language", attrName = "language", label = "倾向语言"),
        @Column(name = "real_name", attrName = "realName", label = "真实姓名"),
        @Column(name = "has_allergic_history", attrName = "hasAllergicHistory", label = "是否有过敏史"),
        @Column(name = "allergic_history", attrName = "allergicHistory", label = "过敏史"),
        @Column(name = "open_id", attrName = "openId", label = "微信Id"),
        @Column(name = "password", attrName = "password", label = "密码"),
        @Column(includeEntity = DataEntity.class),
	},joinTable = {
        @JoinTable(type = Type.LEFT_JOIN, entity = Enterprise.class, alias = "e", on = "e.id = a.enterprise", attrName = "enterprise", columns = {@Column(name = "name", label = "名称")}),
	}, orderBy = "a.update_date DESC"
)
public class Leaguer extends DataEntity<Leaguer>{
	private static final long serialVersionUID = 1L;
	
	private String name;
	private String idNumber;
	private String cellphone;
	private String sex;
	private Date birthday;
	private Boolean isEnterprise;
	private Enterprise enterprise;
	private Date registerDate;
	private String bindingRecord;
	private Date lastVisitDate;
	private String insurer;
	private String insuranceNumber;
	private String certificateType;
	private String language;
	private String realName;
	private Boolean hasAllergicHistory;
	private String allergicHistory;
	private String password;
	private String openId;
	
	public Leaguer(){
		super();
	}
	
	public Leaguer(String id){
		super(id);
	}

	@ExcelField(title="姓名", sort=1)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ExcelField(title="身份证号", sort=2)
	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}

	@ExcelField(title="手机号", sort=3)
	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	@ExcelField(title="性别", sort=4, dictType="sys_user_sex")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@JsonFormat(pattern = "yyyy-MM-dd")
	@ExcelField(title="出生日期", sort=5, dataFormat="yyyy-MM-dd")
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@ExcelField(title="是否为企业会员", sort=6)
	public Boolean getIsEnterprise() {
		return isEnterprise;
	}

	public void setIsEnterprise(Boolean isEnterprise) {
		this.isEnterprise = isEnterprise;
	}

	@ExcelField(title="归属企业", sort=7)
	public Enterprise getEnterprise() {
		return enterprise;
	}

	public void setEnterprise(Enterprise enterprise) {
		this.enterprise = enterprise;
	}

	@JsonFormat(pattern = "yyyy-MM-dd")
	@ExcelField(title="注册时间", sort=8, dataFormat="yyyy-MM-dd")
	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	@ExcelField(title="绑定记录", sort=9)
	public String getBindingRecord() {
		return bindingRecord;
	}

	public void setBindingRecord(String bindingRecord) {
		this.bindingRecord = bindingRecord;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="上次访问时间", sort=10, dataFormat="yyyy-MM-dd HH:mm:ss")
	public Date getLastVisitDate() {
		return lastVisitDate;
	}

	public void setLastVisitDate(Date lastVisitDate) {
		this.lastVisitDate = lastVisitDate;
	}
	
	@ExcelField(title="保险公司", sort=11, dictType="fl_insurer")
	public String getInsurer() {
		return insurer;
	}

	public void setInsurer(String insurer) {
		this.insurer = insurer;
	}

	@ExcelField(title="保险卡号", sort=12)
	public String getInsuranceNumber() {
		return insuranceNumber;
	}

	public void setInsuranceNumber(String insuranceNumber) {
		this.insuranceNumber = insuranceNumber;
	}

	@ExcelField(title="证件类型", sort=13, dictType="fl_certificate_type")
	public String getCertificateType() {
		return certificateType;
	}

	public void setCertificateType(String certificateType) {
		this.certificateType = certificateType;
	}

	@ExcelField(title="倾向语言", sort=14, dictType="fl_language")
	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	@ExcelField(title="真实姓名", sort=15)
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	@ExcelField(title="是否有过敏史", sort=16, dictType="sys_yes_no")
	public Boolean getHasAllergicHistory() {
		return hasAllergicHistory;
	}

	public void setHasAllergicHistory(Boolean hasAllergicHistory) {
		this.hasAllergicHistory = hasAllergicHistory;
	}

	@ExcelField(title="过敏史", sort=17)
	public String getAllergicHistory() {
		return allergicHistory;
	}

	public void setAllergicHistory(String allergicHistory) {
		this.allergicHistory = allergicHistory;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}
	
}
